package com.lagou.rpc.consumer;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.consumer.proxy.RpcClientProxy;
import com.lagou.rpc.pojo.User;

/**
 * 测试类
 */
public class ClientBootStrap {
    public static void main(String[] args) {
        RpcClientProxy clientProxy = new RpcClientProxy();
        IUserService userService = (IUserService) clientProxy.createProxy(IUserService.class);
        for (int i = 0; i < 5; i++){
            new Thread(() -> {
                User user = userService.getById(1);
                System.out.println(Thread.currentThread().getName()+ " " + user);
            },"thread_" + i).start();
        }
    }
}
